<?php
/**
* @version		$Id: view.html.php 1299665130 2011-07-21 21:19:41 ngoquangbieu@yahoo.com.vn $
* @package		Joomla 1.5.x
* @subpackage	Htbn_thongkethuchis
* @copyright	Copyright (C) 2010 - 2011 Open Source Matters. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );

jimport( 'joomla.application.component.view');
jimport('joomla.html.pane');

/**
 * HTML View class for the Htbn_thongkethuchis component
 *
 * @static
 * @package		Joomla 1.5.x
 * @subpackage	Htbn_thongkethuchis
 */
class Htbn_thongkethuchisViewHtbn_thongkethuchi extends JView
{
	function display($tpl = null)
	{
		global $mainframe;

		$lang =& JFactory::getLanguage();
		$extension = 'com_htbn_thongkethuchi';
		$base_dir = JPATH_ADMINISTRATOR;
		$language_tag = 'vi-VN';
		$lang->load($extension, $base_dir, $language_tag, true);
		//print_r($_GET);
		$y = JRequest::getVar('y', '');
		$m = JRequest::getVar('m', '');
		$w = JRequest::getVar('w', '');
		$d = JRequest::getVar('d', '');
		$this->assign('thoi_gian', "&y=$y&m=$m&w=$w&d=$d");
		
		if($this->getLayout() == 'form') {
			$this->_displayForm($tpl);
			return;
		}

		//get the htbn_thongkethuchi
		$htbn_thongkethuchi =& $this->get('data');

		if ($htbn_thongkethuchi->url) {
			// redirects to url if matching id found
			$mainframe->redirect($htbn_thongkethuchi->url);
		}

		parent::display($tpl);
	}

	function _displayForm($tpl)
	{
		global $mainframe, $option;

		$db		=& JFactory::getDBO();
		$uri 	=& JFactory::getURI();
		$user 	=& JFactory::getUser();
		//$model	=& $this->getModel();
		
		$editor =& JFactory::getEditor();
		
		JHTML::_('behavior.calendar');
		JHTML::_('behavior.modal', 'a.modal-button');
		$button = new JObject();
		$button->set('modal', true);
		$button->set('modalname', 'modal-button');
		$button->set('options', "{handler: 'iframe', size: {x: 760, y: 520}}");

		$lists = array();

		//get the htbn_thongkethuchi
		/*$htbn_thongkethuchi	=& $this->get('data');
		$isNew		= ($htbn_thongkethuchi->id < 1);

		// Edit or Create?
		if ($isNew) {
			// initialise new record
			//$htbn_thongkethuchi->published = 1;
		}

		
		
		$this->assignRef('lists', $lists);
		$this->assignRef('htbn_thongkethuchi', $htbn_thongkethuchi);
		$this->assignRef('button', $button);
		$this->assignRef('editor', $editor);
		$this->assign('action', $uri->toString());
		
		$paramfile 	= JPath::clean(JPATH_COMPONENT.'/views/htbn_thongkethuchi/params.xml');
		$params = new JParameter(@$htbn_thongkethuchi->params, $paramfile);
		$sliders = JPane::getInstance('sliders');
		$this->assignRef('pane', $sliders);
		$this->assignRef('params', $params);*/
	
		parent::display($tpl);
	}
}
